package com.wangp.userpermission.controller;

import com.wangp.userpermission.dto.UserPermissionDTO;
import com.wangp.userpermission.dto.UserPermissionQueryRespDTO;
import com.wangp.userpermission.dto.UserPermissionQueryReqDTO;
import com.wangp.userpermission.service.UserPermissionService;
import com.wangp.userpermission.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 第一行简要描述.
 * </p>
 *
 * @author wangping
 * @since 2024-12-24
 */
@RestController
@RequestMapping("/v1")
public class UserPermissionController {

    @Autowired
    private  UserPermissionService userpermissionService;


    /**
     * 查询用户信息及权限
     * @return
     */
    @GetMapping("userpermission")
    public Result<UserPermissionQueryRespDTO> list(UserPermissionQueryReqDTO userPermissionQueryReqDTO){
        userpermissionService.queryPage(userPermissionQueryReqDTO);
        return Result.ok();
    }



    @GetMapping("userpermission/{id}")
    public Result<UserPermissionDTO> query(@PathVariable Integer id) {
        return Result.ok(userpermissionService.queryInfoById(id));
    }

//    //todo 新增修改员工
//    @PostMapping("/employee")
//    public Result upsert( @RequestBody UpsertEmpsDTO upsertEmpsDTO) {
//        employeeService.upsertEmps(upsertEmpsDTO);
//        return Result.ok();
//    }
//
//    //todo 删除员工信息
//    @DeleteMapping("employee")
//    public Result<Integer> disable(Integer id) {
//        employeeService.disableInfo(id);
//        return Result.ok();
//    }


}
